package com.android.chessgame;

import androidx.appcompat.app.AppCompatActivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

    public static final String TAG ="MainActivity";

    private Button btnMachine;
    private Button btnEnter;
    private Button btnBluetooth;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        initView();
        initListener();
    }

    private void initListener() {
        //人机对战
        btnMachine.setOnClickListener(view -> {
            startActivity(new Intent(this,MachineActivity.class));
        });
        //人人对战
        btnEnter.setOnClickListener(view -> {
            startActivity(new Intent(this,RJGameActivity.class));
        });
        //蓝牙对战
        btnBluetooth.setOnClickListener(view -> {
            startActivity(new Intent(this,GameActivity.class));
        });
    }

    private void initView() {
        btnMachine = findViewById(R.id.btnMachine);
        btnEnter = findViewById(R.id.btnEnter);
        btnBluetooth = findViewById(R.id.btnBluetooth);
    }
}